package com.zzty.txj.dao;

import com.zzty.txj.entity.Daily;
import com.zzty.txj.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DailyMapper {
    @Insert("insert into daily(name,money,startTime,stopTime,checkLocation,location) values(#{name},#{money},#{startTime},#{stopTime},#{checkLocation},#{location})")
    public Integer insertDaily(Daily daily);

    @Delete("delete from daily where id=#{id}")
    public Integer deleteDaily(Daily daily);

    @Select("select * from userDaily where userId=#{userId}")
    public String getDailyIdByUserId(Integer userId);

    @Select("select * from user where openId=#{openId}")
    public User getUserByOpenId(String openId);

    @Select("select * from daily where id=#{id}")
    public Daily getDailyByDailyId(Integer id);

    @Select("select * from daily")
    public List<Daily> getDaily();
}
